package network;

//** Enum des messages que le serveur peut envoyer au client  **/
public enum KrakenServerMsg implements KrakenCommandMaker {
	CIPHER_SERVER("CIPHER_SERVER"),
	
	SEND_HEADER("SEND_HEADER"),
	SEND_DATA("SEND_DATA"),
	SEND_FLUX("SEND_FLUX"),
	SEND_NEXT_FRAME("SEND_NEXT_FRAME"),
	REINITIALISATION_CONFIRMED("REINITIALISATION_CONFIRMED"),
	
	SEND_KEY("SEND_KEY"),
	
	END_SERVER("END_SERVER"),
	
	ERROR("ERROR"),
	UNKNOWN_COMMAND("UNKNOWN_COMMAND"),
	TIMEOUT("TIMEOUT");
		
	public String msg;

	private KrakenServerMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String makeCommand(String... values) {
		StringBuilder sb = new StringBuilder(msg);
		if(values!=null){
			for(String v:values){
				sb.append(" "+v);
			}
		}
		return sb.toString();
	}
}
